package psn.kiko.mapper.business.associated;

import org.apache.ibatis.annotations.Mapper;
import psn.kiko.pojo.entity.system.InterfaceEntity;
import psn.kiko.pojo.entity.system.InterfaceRoleEntity;
import psn.kiko.pojo.vo.InterfaceVO;

import java.util.List;

/**
 *接口-角色中间表DAO
 */
@Mapper
public interface InterfaceRoleMapper{
	
	/**
	 * 根据角色id和接口id批量更新状态
	 * */
	Integer batchUpdateStatus(List<Integer> roleIds,List<Integer> interfaceIds,int enableOrDisable);
	
	/**
	 * 根据角色id、接口id批量删除
	 * */
	Integer batchDelete(List<Integer> roleIds,List<Integer> interfaceIds);
	
	/**
	 * 批量插入
	 * */
	Integer batchInsert(List<InterfaceRoleEntity> list);
	
	/**
	 * 根据接口id、角色id集合获取 接口-角色实体
	 */
	InterfaceRoleEntity selectByApiIdAndRoleIds(Integer apiId,List<Integer> roleIds);
	
	/**
	 * 获取角色已分配的接口列表
	 */
	List<InterfaceVO> selectAllocatedInterfaceOfRole(int roleId,InterfaceEntity interfaceEntity);
	
	/**
	 * 获取角色还未分配的接口列表
	 */
	List<InterfaceVO> selectUnallocatedInterfaceOfRole(int roleId,InterfaceEntity interfaceEntity);
}
